package com.example.demo.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class JdbcTest {
    void test() throws ClassNotFoundException, SQLException{
        String URL="jdbc:mysql://192.168.80.64:3306/soft_test?characterEncoding=utf-8";
        String USER="root";
        String PASSWORD="123456";
        Class.forName("com.mysql.jdbc.Driver");
        Connection conn= DriverManager.getConnection(URL,USER,PASSWORD);
        System.out.println(conn.isClosed());

        String sql="INSERT INTO t_student(name,idno,age) VALUES ('李四','xxxxxx',22)";
        Statement statement=conn.createStatement();
        boolean execute=statement.execute(sql);
        System.out.println(execute);
    }
}
